﻿<%@ MasterType VirtualPath="~/Main.master" %>

<%@ Page Title="Customer Management System" Language="C#" MasterPageFile="~/Main.Master"
    AutoEventWireup="true" CodeBehind="Main.aspx.cs" Inherits="Touch2Like.Web.Customer.Main" %>

<asp:Content ID="headContent" ContentPlaceHolderID="headcontent" runat="server">
    <link href="/css/smoothness/jquery-ui-1.9.1.custom.min.css" rel="stylesheet" type="text/css" />
    <script src="/js/jquery-ui-1.9.1.custom.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("#btn_AddTag").click(function () {
                $("#ifrEditTag").attr("src", "Popup/AddTag.aspx");
                $("#dialog").dialog({ height: 360, width: 600, modal: true, resizable: false, minWidth: 600, minHeight: 360, maxWidth: 600, maxHeight: 360 });
            });
            $(".edititem").click(function () {
                $("#ifrEditTag").attr("src", "Popup/AddTag.aspx?ListID=" + $(this).attr("item-value"));
                $("#dialog").dialog({ height: 360, width: 600, modal: true, resizable: false, minWidth: 600, minHeight: 360, maxWidth: 600, maxHeight: 360 });
            });
            $("#cb_All").click(function () {
                if ($(this).attr("checked")) {
                    $(".cb_Single :checkbox").attr("checked", true);
                } else {
                    $(".cb_Single :checkbox").attr("checked", false);
                }
            });
        });

        function hideDialog() {
            $("#dialog").dialog("close");
        }

        function ConfirmMsg(msg) {
            if (confirm(msg)) {
                return true;
            } else {
                event.cancelBubble = true;
                event.returnValue = false;
                return false;
            }
        }
    </script>
</asp:Content>
<asp:Content ID="mainContent" ContentPlaceHolderID="maincontent" runat="server">
    <div id="dialog" title="Register your NFC Tag" style="display: none; padding: 0px;">
        <iframe id="ifrEditTag" src="Popup/AddTag.aspx" frameborder="0" style="width: 580px;
            height: 310px;"></iframe>
    </div>
    <div id="header_bottom">
        <div class="container clearfix">
            <div class="sidebar" style="width: 158px;">
                <div>
            <div><a href="/Customer/Dashboard.aspx">Dashboard</a></div>
                    <div>
                        <a href="/Customer/Profile.aspx">My Account</a></div>
                    <div>
                        <a href="/Customer/Main.aspx">Manage Tags</a></div>
                    <%--                <div>
                    <a href="/Customer/Orders.aspx">Orders</a></div>--%>
                    <div>
                        <a href="/Customer/statistics.aspx">Statistics</a></div>
                </div>
            </div>
            <div class="grid8 table_wrapper">
                <div style="height: 40px;">
                    <input id="btn_AddTag" type="button" class="Submit" value="Add Tag" />
                    <asp:Button ID="btn_Delete" runat="server" CssClass="Submit" Text="Delete" OnClientClick="return ConfirmMsg('Are you sure you want to delete these items.');"
                        OnClick="btn_Delete_Click" />
                </div>
                <asp:GridView ID="GridView_Tag" runat="server" AutoGenerateColumns="false" Width="700px"
                    AllowPaging="true" AllowSorting="true" PageSize="20" OnPageIndexChanging="GridView_Tag_PageIndexChanging"
                    OnSorting="GridView_Tag_Sorting">
                    <Columns>
                        <asp:TemplateField SortExpression="ListID">
                            <ItemTemplate>
                                <asp:CheckBox ID="cb_ListID" runat="server" CssClass="cb_Single" />
                <%--                <asp:HiddenField ID="tb_ListID" runat="server" Value='<%#Eval("ListID") %>' />--%>
                            </ItemTemplate>
                            <HeaderTemplate>
                                <input type="checkbox" id="cb_All" />
                            </HeaderTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Tag UID" SortExpression="TagUID">
                            <ItemTemplate>
                                <%#Eval("TagUID") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Alias" SortExpression="Alias">
                            <ItemTemplate>
                                <%#Eval("Alias") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Destination Site" SortExpression="ServiceURL">
                            <ItemTemplate>
                                <%#Eval("TagContent")%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <%--<asp:TemplateField>
                            <ItemTemplate>
                                <input type="button" value="Edit" item-value='<%#Eval("ListID") %>' class="Submit edititem" />
                            </ItemTemplate>
                        </asp:TemplateField>--%>
                    </Columns>
                </asp:GridView>
            </div>
            <div class="clear">
            </div>
        </div>
    </div>
</asp:Content>
